<include file="Public:header"/>
<div class="cat" style="margin-top:10px;">
 <form method="POST" action="__URL__/add">
	<p>规格名：<input type="text" name="prop_name" size="20" style="width:177px"></p>
	<p>规格值：<textarea rows="5" name="prop_value" cols="20"></textarea></p>
	<p><input type="submit" value="添加规格" name="B1" style="padding:3px"></p>
</form>
</div>

<div class="cat" style="margin-top:10px;">
<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="300">规格名称</td>
		<td class="title" width="80">查看规格值</td>
		<td class="title" width="40">删除</td>
		<td class="title">　</td>
	</tr>
<volist name="props" id="props">
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="300"><input type="text" name="prop_name[]" value="{$props.prop_name}"></td>
		<td width="80" align="center"><a href="__URL__/edit/?prop_name={$props.prop_name|urlencode}"><img src="__APP__/statics/add44.gif"></a></td>
		<td width="40" align="center"><input type="text" value="{$props.prop_name}" style="display:none"><img onclick="del('{$props.prop_name}')" alt="删除" src="__APP__/statics/icons/icon_delete.gif"></td>

		<td></td>
	</tr>
</volist>
</table>
</div>
<div id="save"><input id="save_m" type="button" value="保存更改"></div>
<script>
function del(t){
    var name=t;//这里删除的标准是@规格名@不是id
	if(confirm('你确认删除此规格吗？')) {
		$.ajax({
			 type:"POST",
			 url:"__URL__/del",
			 dataType:"json",
			 data:{'name':name},
			 success:function(data){
				if(data=='0'){
					jError("<strong>删除失败!</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
				}else{
					jSuccess("<strong>删除成功！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}});
				}
			 }
		})
	}
}
</script>





